import QtQuick 1.0

Rectangle
{
    id: recParent
    border.color: "#acbbdb"
    property string textButtonAccept: idButtonSave.text
    property string textButtonCancel: idButtonCancel.text
    property alias  text:idTextInput.text
    property alias  focusInput:idTextInput.focus
    property alias  maximumLength: idTextInput.maximumLength
    //property alias  forceActiveFocus: idTextInput.forceActiveFocus
    function forceActiveFocus()
    {
        idTextInput.forceActiveFocus()
    }

    signal accept
    signal cancel
    width: 300
    height: 60

    MouseArea
    {
        x: 1
        y: 1
        anchors.rightMargin: -1
        anchors.bottomMargin: -1
        anchors.leftMargin: 1
        anchors.topMargin: 1
        anchors.fill: parent
    }
    TextInput
    {
        id: idTextInput
        x: 5
        y: 2
        width: recParent.width-10
        height: 20
        font.family: "Arial"
        cursorVisible: true
        focus:true
        cursorPosition:text.length
        maximumLength: 200
    }

    TextButton {
        id: idButtonSave
        x: 0
        y: 33
        width: 51
        height: 21
        text: "Save"
        colorGradientTo: "#acbbdb"
        opacity: 1
        font.bold:true
        onClicked:
           accept()

    }

    Text {
        id: text3
        x: 100
        y: 35
        text: "or"
        anchors.left: idButtonSave.left
        anchors.leftMargin: idButtonSave.x + idButtonSave.width +10
        opacity: 1
    }

    TextButton
    {
        id: idButtonCancel
        x: 87
        y: 33
        width: 51
        height: 21
        anchors.left: text3.left
        color: "#f51010"
        text: "Cancel"
        anchors.leftMargin: 17
        colorGradientTo: "#acbbdb"
        opacity: 1
        font.underline:true
        onClicked:
            cancel()
      }


}
